<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CSS布局复习</title>

    <style>
    .outer {
      display: flex;
      position: relative;
      width: 300px;
      height: 300px;
      margin: 0 auto;
      background-color: pink;
      text-align: center;
    }

    .inner1 {
      background-color: blue;
      width: 80px;
      height: 80px;
      line-height: 80px;
      text-align: center;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin: auto;
    }

    .inner2 {
      background-color: red;
      width: 100px;
      height: 50px;
    }
    .inner3 {
      background-color: orchid;
      width: 100px;
      height: 50px;
    }

    </style>

  </head>
  <body>


    已知宽高，进行水平垂直居中</br>

    <section class="outer">
      <div class="inner1">sss</div>
      <div class="inner2">ttt</div>
      <div class="inner3">mmm</div>
    </section>
  </body>
</html>
